<!--<!DOCTYPE html>-->
<!--<html lang="cn">-->
<!--<head>-->
  <!--<meta charset="UTF-8">-->
  <!--<title>Summernote</title>-->
  <!--<link href="http://netdna.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.css" rel="stylesheet">-->
  <!--<script src="http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.4/jquery.js"></script> -->
  <!--<script src="http://netdna.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.js"></script> -->
  <!--<link href="http://cdnjs.cloudflare.com/ajax/libs/summernote/0.8.2/summernote.css" rel="stylesheet">-->
  <!--<script src="http://cdnjs.cloudflare.com/ajax/libs/summernote/0.8.2/summernote.js"></script>-->
<!--</head>-->
<!--<body style="padding: 10px 10px 10px;">-->
<!--<form id="myForm" class="form-horizontal" autocomplete="off" data-validator-option="{theme:'default'}">-->
  <!--<div style="padding: 10px 10px 10px;">-->
    <!--<form class="bs-example bs-example-form" role="form">-->
      <!--<input type="hidden" name="id" value="$!{employee.id}">-->
      <!--<div class="input-group">-->
        <!--<span class="input-group-addon">员工姓名</span>-->
        <!--<input type="text" name="id" class="form-control" value="$!{employee.name}" placeholder="twitterhandle">-->
      <!--</div>-->
      <!--<br>-->
      <!--<div class="input-group">-->
        <!--<span class="input-group-addon">.00</span>-->
        <!--<input type="text" class="form-control">-->
      <!--</div>-->
      <!--<br>-->
      <!--<div class="input-group">-->
        <!--<span class="input-group-addon">$</span>-->
        <!--<input type="text" class="form-control">-->
        <!--&lt;!&ndash;<span class="input-group-addon">.00</span>&ndash;&gt;-->
      <!--</div>-->
    <!--</form>-->
  <!--</div>-->
  <!--<div id="summernote" style="padding: 10px 10px 10px;"><p>Hello Summernote</p></div>-->
  <!--<script>-->
    <!--$(document).ready(function() {-->
      <!--$('#summernote').summernote({-->
        <!--height: 300,                 // set editor height-->
        <!--minHeight: null,             // set minimum height of editor-->
        <!--maxHeight: null,             // set maximum height of editor-->
        <!--focus: true                  // set focus to editable area after initializing summernote-->
      <!--});-->
    <!--});-->
  <!--</script>-->
<!--</form>-->
<!--</body>-->
<!--</html>-->



<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>INSPINIA | Basic Form</title>
  <link href="#springUrl('/static/css/bootstrap.min.css')" rel="stylesheet">
  <link href="#springUrl('/static/css/style.css')" rel="stylesheet">
</head>

<body class="white-bg">
<div class="ibox-content" style="width: 430px;">
  <form id="myForm" class="form-horizontal" autocomplete="off" data-validator-option="{theme:'default'}">
    <input type="hidden" name="id" value="$!{employee.id}">
    <input type="hidden" name="departmentid" id="departmentid" value="$!{employee.departmentid}">
    <input type="hidden" name="employeenum" id="employeenum" value="$!{employee.employeenum}">
    <div class="form-group"><label class="col-sm-2 control-label">员工名</label>
      <div class="col-sm-10">
        <input type="text" class="form-control" value="$!{employee.name}" name="name"
               data-rule="员工名:required;name">
      </div>
    </div>
    <div class="hr-line-dashed"></div>

    <div class="form-group"><label class="col-sm-2 control-label">考勤类型</label>
      <div class="col-sm-10">
        <select id="event" name="event" >
          <option value=0>请假</option>
          <option value=1>旷工</option>
          <option value=2>出勤</option>
        </select>
      </div>
    </div>
    <div class="hr-line-dashed"></div>

    <input type="date" name="date" >

    <div class="hr-line-dashed"></div>
    <div class="form-group"><label class="col-sm-2 control-label">备注</label>
      <div class="col-sm-10">
        <input type="text" class="form-control"  name="remarks" maxlength="85"
               data-rule="备注:required;name">
      </div>
    </div>


    <div class="hr-line-dashed"></div>
    <div class="form-group">
      <div class="text-center">
        <button class="btn btn-primary" type="submit">#if($!{user})修 改#else提 交#end</button>
      </div>
    </div>
  </form>
</div>
<script src="#springUrl('/static/js/jquery-2.1.1.js')"></script>
<script src="#springUrl('/static/plugins/nice-validator-0.8.1/jquery.validator.js?local=zh-CN')"></script>
<script type="text/javascript">
  $("#myForm").validator({
    valid: function (form) {
      var me = this;
      // 提交表单之前，hold住表单，防止重复提交
      me.holdSubmit();
      $.ajax({
        url: "#springUrl('/attendance/addAttendance')",
        data: $(form).serialize(),
        type: "POST",
        success: function (data) {
          var d = JSON.parse(data);
          if (d.success && d.data) {
            window.parent.location.reload();
            //当你在iframe页面关闭自身时
            //var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
            //parent.layer.close(index); //再执行关闭
          } else {
            //失败，提交表单成功后，释放hold，如果不释放hold，就变成了只能提交一次的表单
            me.holdSubmit(false);
          }
        }
      });
    }
  });

//  $(function(){
////    var sexValue=$("#hidden_sex").val();
////    var departmentValue=$("#hidden_departmentid").val();
////    if (sexValue != "" && sexValue!=null&& departmentValue != "" && departmentValue !=null) {
////      $("#departmentid").val(departmentValue)
////      $("#sex").val(sexValue);
////    }
////  })


</script>
</body>
</html>
